package com.csair.platform.cit.service.controller;

import com.alibaba.fastjson.JSON;
import com.csair.invoice.common.base.vo.JsonResult;
import com.csair.platform.cit.facade.CitJscgApi;
import com.csair.platform.cit.facade.model.citJscg.CitJscgRequest;
import com.csair.platform.cit.service.biz.ICitJscgService;
import com.csair.platform.cit.service.core.CheckDataPermission;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhengxincheng
 * 技术成果投资入股企业所得税递延纳税备案表
 */
@Api(tags = "技术成果投资入股企业所得税递延纳税备案表")
@Slf4j
@RestController
public class CitJscgController extends BaseController implements CitJscgApi {

    @Autowired
    ICitJscgService ICitJscgService;

    @CheckDataPermission
    @ApiOperation(value = "企业所得税-保存")
    @Override
    public JsonResult save(@RequestBody CitJscgRequest czs) {
        log.info("技术成果投资入股企业所得税递延纳税备案表:{}", JSON.toJSONString(czs));
        ICitJscgService.save(czs);
        return JsonResult.success();
    }

    @CheckDataPermission
    @ApiOperation(value = "企业所得税-根据税号查询")
    @Override
    public JsonResult query(@RequestBody  CitJscgRequest cjq) {
        log.info("技术成果投资入股企业所得税递延纳税备案表:{}", JSON.toJSONString(cjq));
        CitJscgRequest data = ICitJscgService.queryByNsrsbhAndSkssqqAndSkssqz(cjq);
        return JsonResult.success(data);
    }
}
